import TipPanel from "./TipPanel";
import WinLosePanel from "./WinLosePanel";
import GameManager from "../Manager/GameManager";


const {ccclass, property} = cc._decorator;

@ccclass
export default class ResurrectionPanel extends cc.Component {
    public static Instance:ResurrectionPanel;

    @property(cc.Node)
    Button_ok:cc.Node = null;

    @property(cc.Node)
    Button_cancel:cc.Node = null;


    onLoad () {
        ResurrectionPanel.Instance = this;
    }

    start () {
        this.Button_ok.on('click', this.click_ok, this);
        this.Button_cancel.on('click', this.click_cancel, this);
    }

    ShowOn()
    {
        this.node.active = true;
    }

    ShowOff()
    {
        this.node.active = false;
    }

    click_ok(button)
    {
        this.ShowOff();
        GameManager.Instance.Resurrection();
    }

    click_cancel(button)
    {
        this.ShowOff();
        WinLosePanel.Instance.ShowOn(2);

        
    }

}
